<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>JavaScript 数组 </title>
</head>
<body>
<h2>length 属性</h2>
<p>返回数组的长度（数组元素的数目）</p>

<p id="demo"></p>

<script>
  var fruits = ["Banana", "Orange", "Apple", "Mango"];
  document.getElementById("demo").innerHTML = fruits.length;
</script>
</body>
</html>

<!--4

length 属性始终大于最高数组索引（下标）。
-->